<?php

namespace backend\assets;

use yii\web\AssetBundle;

/**
 * Main backend application asset bundle.
 */
class ChatAsset extends AssetBundle
{
    public $sourcePath = '@app/assets/chat';
    
    public $js = [
        'demo/javascript/dist/browser-polyfill.min.js',
        'demo/javascript/dist/webim.config.js',
        //'sdk/dist/websdk-1.4.13.js',
        //'demo/javascript/dist/demo-1.4.13.js',
        'demo/javascript/dist/swfupload/swfupload.min.js',
    ];
    public $jsOptions = [
        'position' => \yii\web\View::POS_HEAD
    ];
    public $depends = [
        
        //'yii\bootstrap\BootstrapAsset',
        //'yii\web\YiiAsset',
    ];
    //定义按需加载JS方法，注意加载顺序在最后
    public static function addScript($view,$jsfile) 
    {
        $view->registerJsFile($jsfile,[WenmingAsset::className(),'depends'=>'backend\assets\WenmingAsset']);
    }

    //定义按需加载CSS方法，注意加载顺序在最后
    public static function addCss($view,$cssfile)
    {
        $view->registerCssFile($cssfile,[WenmingAsset::className(),'depends'=>'backend\assets\WenmingAsset']);
    }
}
